﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace Kira.Compiler.Bods
{
    [XmlElementMapping("COLUMN_REFERENCE")]
    public class ColumnReference : BodsExpression
    {

        public bool HasTableName
        {
            get { return this.HasAttribute("qualifier1"); }
        }

        public String TableName
        {
            get { return this.GetAttrbuteValue("qualifier1"); }
        }

        public String ColumnName
        {
            get { return this.GetAttrbuteValue("column"); }
        }

        public override string ToString()
        {
            return HasTableName ? TableName + "." + ColumnName : ColumnName;
        }
    }
}
